﻿@model KL.Store.Web.Models.SalesModel
@{
    Layout = null;
    DateTime DefaultDate = new DateTime(1900, 1, 1, 0, 0, 0);
}
<div class="table-responsives">
    <table class="table table-bordered table-hover">
        <thead>
            <tr>
                <td class="hideOnMobile">Barkod</td>
                <td>Stok Adı</td>
                <td>Miktar</td>
                <td>Toplam Fiyat</td>
                <td class="hideOnMobile">Birim Fiyat</td>
                <td class="hideOnMobile">Ödeme Tipi</td>
                <td class="hideOnMobile">Yapılan İskonto</td>
                <td class="hideOnMobile">Fatura No</td>
                <td class="hideOnMobile">Fatura Tarihi</td>
                <td>Çıkış Noktası</td>
                <td class="hideOnMobile">Cari Grup</td>
            </tr>
        </thead>
        <tbody>
            @foreach (var sale in Model.SalesList)
            {
                <tr class="level@(sale.Sira)">
                    <td class="hideOnMobile">@sale.Barkod</td>
                    @if (sale.Sira == 0)
                    {
                        <td><a href="@sale.LinkUrl" target="_blank">@sale.StokAdi</a></td>                    
                    }
                    else
                    {
                        <td>@sale.StokAdi</td>
                    }
                    <td>@sale.Miktar.ToString("###,###,##0")</td>
                    <td>@sale.ToplamFiyat.ToString("###,###,##0.00") TL</td>
                    <td class="hideOnMobile">@sale.BirimFiyat.ToString("###,###,##0.00") TL</td>
                    <td class="hideOnMobile">@sale.OdemeTipi</td>
                    <td class="hideOnMobile">@sale.YapilanIskonto.ToString("###,###,##0.00") TL</td>
                    <td class="hideOnMobile">@if (sale.FaturaNo != 0)
                                             {@sale.FaturaNo}</td>
                    <td class="hideOnMobile">@if (sale.FaturaTarihi != DefaultDate)
                                             { @sale.FaturaTarihi }</td>
                    <td>@if (sale.AmbarId != null && sale.AmbarId != 0)
                        { @Model.AmbarList.Where(o => o.IdAmbar == sale.AmbarId).FirstOrDefault().AmbarAdi}</td>
                    <td class="hideOnMobile">@sale.CariGrup</td>
                </tr>
                        if (sale.AmbarId != 1)
                        {
                        }
            }
        </tbody>
    </table>
</div>
